pragma Ada_2012;
private with System;
private with Ada.Finalization;
package iconv is
   type iconv_t is private;

--   function Success return Boolean;

   function Open (
      From_Code, To_Code : String
      ) return iconv_t;

   function Convert (
      cd : iconv_t;
      src : String
      ) return String;

   procedure Close (ic : iconv_t);

   type Handle is tagged limited private;

   function Create (From, To : String) return Handle;

   function Convert (this : Handle; Source : String) return String;

   procedure Open (this : in out Handle; From, To : String);

   procedure Close (this : in out Handle);

private
   type iconv_t is new System.Address;

   type Handle is new Ada.Finalization.Limited_Controlled with record
      ic : iconv_t := iconv_t(System.Null_Address);
   end record;

   overriding
   procedure Finalize (this : in out Handle);

end iconv;
